package com.example.networkcore.retrofit

import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers

class BaseObserable {
    fun <T> doIt(result: Observable<T>, success: Consumer<T>, failed:Consumer<Throwable>){
        result.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
            .subscribe(success,failed)
    }
}